<@admin.header title="权限管理列表">
<script type="text/javascript">
    $(document).ready(function(){
    	App.ns('M');
		
		
		M.form = new App.common.Form({
			base:'${base}/auth/permission'
		});
		M.delAll = function(){
			var ids = Role.form.getCheckboxValues();
			M.form.deleteRecord(ids);
		}
		
		M.del = function(ids){
			M.form.deleteRecord(ids);
		}
    });
</script>
<style>
	.sndTitle {font-weight:normal;}
</style>

</@admin.header>
    <body>
        <div class="place">
            <span>位置：</span>
            <ul class="placeul">
                <li>
                    <a href="#">首页</a>
                </li>
                <li>
                    <a href="list.do">系统权限管理</a>
                </li>
                <li>
                    <a href="#">权限管理列表</a>
                </li>
            </ul>
        </div>
        <div class="rightinfo">
        <!--默认查询表单-->
        <form action="list.do" method="get" id="searchForm">
            <input type="hidden" name="pageNo" value="1"/>
            <div class="tools">
                <ul class="toolbar">
                    <li class="click">
                        <a href="add.do"><span><img src="${base}/resources/images/t01.png" /></span>添加</a>
                    </li>
                </ul>
            </div>
		</form>
		<#list permissionList as p>
		<div class="infoleft" style="width:100%;height:auto;margin-bottom:10px;">
			<div class="listtitle">
				<a href="javascript:M.del(${p.id});" class="more1">删除</a>
				<a href="edit.do?id=${p.id}" class="more1">编辑</a>
				<a href="add.do?pid=${p.id}" class="more1">增加子权限</a>
				${p.name!''} &emsp;
				<#if p.description??><a class='sndTitle'>(${p.description!''})</a></#if>
			</div>
			<#if p.children??>
			<table class="tablelist" style="border:0px;">
                <tbody>
                	<#list p.children as d>
                    <tr id="tr_${d.id}">
						<td width="50px">${d_index+1}</td>
                        <td width="200px">${d.name!''}</td>
                        <td width="200px">${d.permission!''}</td>
						<td>${d.description!''}</td>
                        <td width="100px">
                            <a href="edit.do?id=${d.id}" class="tablelink">修改</a>
							&nbsp;
                        	<a href="javascript:M.del('${d.id}')" class="tablelink">删除</a>
                        </td>
                    </tr>
					</#list>
                </tbody>
            </table>
			</#if>
		</div>
		</#list>
        </div>
    </body>
</html>